<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>后台管理</title>

    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/backstage_index.css}" rel="stylesheet"/>
</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <a href="#">汽车购票后台管理</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse manage navbar-right">
            <ul class="nav navbar-nav">
                <li class="actives"><a th:href="@{/ticket/index}">车讯管理</a></li>
                <li><a th:href="@{/customer/index}">用户管理</a></li>
            </ul>
            <div class="user">
                <a href="#">admin</a>
                <a href="#" th:href="@{/admin/login}">注销</a>
            </div>
        </div>
    </div>
</nav>

<div class="container-fluid" id="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav">
                <li class="active"><a th:href="@{/ticket/index}">车讯列表</a></li>
                <li><a th:href="@{/ticket/query}">车讯查询</a></li>
                <li><a th:href="@{/ticket/notice}">车讯公告</a></li>
            </ul>
        </div>
        <div class="col-md-10 col-md-offset-2 main">
            <a class="btn btn-primary btn-block" th:href="@{/ticket/add}">添加+</a>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>始发站</th>
                        <th>终点站</th>
                        <th>线路号</th>
                        <th>车牌</th>
                        <th>日期</th>
                        <th>车位数</th>
                        <th>票价</th>
                        <th style="width: 160px;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="item:${ticket}">
                        <td th:text="${item.id}">id</td>
                        <td th:text="${item.starting_station}">起点站</td>
                        <td th:text="${item.destination}">终点站</td>
                        <td th:text="${item.line_number}">线路号</td>
                        <td th:text="${item.pleat_number}">车牌</td>
                        <td th:text="${item.departure_time}">日期</td>
                        <td th:text="${item.seating}">车位数</td>
                        <td th:text="${item.ticket_price}">票价</td>
                        <td>
                            <a class="btn btn-primary btn-block" th:href="@{/ticket/edit(id=${item.id})}">修改</a>
                            <a class="btn btn-primary btn-block" th:href="@{/ticket/delete(id=${item.id})}">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>
</html>
